<!DOCTYPE html>
<html lang="en">
{__NOLAYOUT__}
<head>
    <meta charset="UTF-8">
    <title>鉴权测试的前端页面</title>
</head>
<body>
    <input type="text" value="1" name="id">
    <input type="text" name="name">
   <button>
       提交
   </button>

</body>
</html>
<script src="\front\js\md5.js">
</script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
<script>
    $('button').click(function () {
        var arr=[];
        var id=$("input[name='id']").val();
        var name=$("input[name='name']").val();
        var timestamps = Math.ceil((new Date()).getTime()/1000);
        arr['timestamps'] = timestamps;
        arr['name']=name;
        arr['id']=id;

       //
       //  //形成签名
       //      //首先一定要排序
       // arr=arr.sort()
       //
       //      //处理数组
       //  var sign='';
       //      for(var i in arr){
       //          //i.sort()
       //          sign+=i+'='+arr[i]+'&'
       //      }
       //  console.log(arr)
       //  sign=sign.substr(0,sign.length-1)
        //对签名进行转化
        sign=create_sign(arr)

      console.log(timestamps)
      console.log(sign)
        $.ajax({
        url:"http://www.job.com/home/test",
        type:'post',
            data:{
                id:id,
                name:name,
                sign:sign,
                timestamps:timestamps
            },
            success:function (e) {
                console.log(e)
            }
        })
        //window.localStorage('token',token)
    })

    
</script>